package com.itheima.test;

public class Demo_001 {
    public static void main(String[] args) {
        //使用递归求5的阶乘;
        int jc = getJc(5);
        System.out.println(jc);
    }

    private static int getJc(int i) {
        if (i == 1) {
            return 1;
        } else {
            return i * getJc(i - 1);

        }
    }
}
